<!--  -->
<template>
    <div class="count">
        默认的count: {{ countObj.count }}

        <button @click="add">点击增加</button>
    </div>
</template>

<script setup lang="ts">
    import { reactive, computed } from 'vue';
    let countObj = reactive({ 
        count: 3,
        double: computed(()=>
            countObj.count * 2
        )
    })
    console.log(countObj)

    function add() {
        countObj.count++;
        console.log(countObj.double)
    }

</script>
<style scoped>

</style>